package com.smz.controller;

import com.smz.entity.SCompany;
import com.smz.service.SCompanyService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

import javax.servlet.http.HttpSession;

@Controller
public class SCompanyInfoController {

    @Autowired
    SCompanyService sCompanyService;
    @GetMapping("/findComIfo/{companyName}")
    public String findComInfo(@PathVariable("companyName")String companyName, HttpSession session){
        SCompany comByCompanyName = sCompanyService.findComByCompanyName(companyName);
        session.setAttribute("comInfo",comByCompanyName);
        return "infoCom";
    }
}
